Building your First Mobile Game using XNA 4.0 by 2012

Building your First Mobile Game using XNA 4.0 by 2012

Author:2012
Language: eng
Format: epub
Publisher: Packt Publishing


LoadContent

In the LoadContent method, we will perform the following steps:

Load the SoundEffect object via the content manager.

Create an instance of the sound effect.

Set volume, pitch, pan, and loop.

Play the sound.

The result should be the sound playing in a loop, one octave higher than the recorded effect, half the current system volume and entirely in the left channel. The code is as follows:

jumpSound = Content.Load<SoundEffect>("Jump"); jumpInstance = jumpSound.CreateInstance(); jumpInstance.Volume = 0.5f; jumpInstance.Pitch = 1.0f; jumpInstance.Pan = -1.0f; jumpInstance.IsLooped = true; jumpInstance.Play();



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.